package me.zk.practice1.hw;

import java.lang.reflect.Array;
import java.util.*;

public class HWBJJ32 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = Integer.parseInt(scanner.nextLine());

        List<Integer> la = new ArrayList<>();

        List<Integer> lb = new ArrayList<>();
        for (int i = 0; i <m; i++) {
            la.add( scanner.nextInt());
        }
        scanner.nextLine();
        for (int i = 0; i < m; i++) {
            lb.add( scanner.nextInt());
        }
        Collections.sort(la);
        Collections.sort(lb);
        int a = m-1;
        int b = m-1;
        int n = 0;
        while (a >=0 && b >=0){
            if (la.get(a) > lb.get(b)){
                a--;
                b--;
                n++;
            } else {
                b--;
            }
        }

    System.out.println(n-a-1);
    }
}
